﻿<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="/public/hui/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/public/hui/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/public/hui/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/public/hui/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/public/hui/static/h-ui.admin/css/style.css" />

<title>CI 后台系统 管理员列表</title>
</head>
<body>
<header class="navbar-wrapper">
	<div class="navbar navbar-fixed-top">
		<div class="container-fluid cl"> <a class="logo navbar-logo f-l mr-10 hidden-xs" href="/">H-ui.admin</a>
			<span class="logo navbar-slogan f-l mr-10 hidden-xs">v3.0</span>
			<a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:;">&#xe667;</a>
			<nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
				<ul class="cl">
					<li>你好：</li>
					<li class="dropDown dropDown_hover"> <a href="#" class="dropDown_A"><?=$account;?> <i class="Hui-iconfont">&#xe6d5;</i></a>
						<ul class="dropDown-menu menu radius box-shadow">
							<li><a href="/administrator">个人信息</a></li>
							<li><a href="#">切换账户</a></li>
							<li><a href="#">退出</a></li>
						</ul>
					</li>
					<li id="Hui-msg"> <a href="#" title="消息">
							<span class="badge badge-danger">1</span>
							<i class="Hui-iconfont" style="font-size:18px">&#xe68a;</i></a></li>
					<li id="Hui-skin" class="dropDown right dropDown_hover"> <a href="javascript:;" class="dropDown_A" title="换肤"><i class="Hui-iconfont" style="font-size:18px">&#xe62a;</i></a>
						<ul class="dropDown-menu menu radius box-shadow">
							<li><a href="javascript:;" data-val="default" title="默认（黑色）">默认（黑色）</a></li>
							<li><a href="javascript:;" data-val="blue" title="蓝色">蓝色</a></li>
							<li><a href="javascript:;" data-val="green" title="绿色">绿色</a></li>
							<li><a href="javascript:;" data-val="red" title="红色">红色</a></li>
							<li><a href="javascript:;" data-val="yellow" title="黄色">黄色</a></li>
							<li><a href="javascript:;" data-val="orange" title="橙色">橙色</a></li>
						</ul>
					</li>
				</ul>
			</nav>
		</div>
	</div>
</header>

<aside class="Hui-aside">

	<div class="menu_dropdown bk_2">
        <? foreach($menus as $k => $v):?>
            <dl>
                <dt><i class="Hui-iconfont"><?=$v['m_icon']?></i> <?=$v['m_name']?><i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i>
                </dt>
                <dd>
                    <ul>
                        <? foreach($v['arr'] as $kk => $vv):?>
                            <li class="<?=$vv['c_func'];?>">
                                <a href="/<?=$vv['c_route']?>" title="系统设置"><?=$vv['c_name']?></a>
                            </li>
                        <? endforeach;?>
                    </ul>
                </dd>
            </dl>
        <? endforeach;?>
	</div>
</aside>
<div class="dislpayArrow hidden-xs"> <a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a> </div>

<section class="Hui-article-box">
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
		<span class="c-gray en">&gt;</span>
		管理员管理
		<span class="c-gray en">&gt;</span>
		管理员列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a> </nav>
	<div class="Hui-article">
		<article class="cl pd-20">
            <form class="layui-form xbs" action="/Systems/administrator">
			<div class="text-c"> 日期范围：
                <input id="d411" class="input-text Wdate"  type="text" name="start_time" value="<?=$start_time;?>" placeholder="开始日"  onclick="WdatePicker({minDate:'2017-01-01',maxDate:'%y-%M-%d'})" style="width:182px;"/>
				-
                <input id="d4312" class="input-text Wdate" type="text" name="end_time" value="<?=$end_time;?>"   placeholder="截止日" onclick="WdatePicker({minDate:'#F{$dp.$D(\'d411\')}',maxDate:'%y-%M-%d'})" style="width:182px;"/>
                <input type="text" name="username" class="input-text" placeholder="请输入用户名" value="<?=$username;?>" autocomplete="off"  style="width:250px">
                <button type="submit" class="btn btn-success" name=""><i class="Hui-iconfont">&#xe665;</i> 搜用户</button>
			</div>
            </form>
			<div class="cl pd-5 bg-1 bk-gray mt-20">
				<span class="l">
                    <a href="javascript:;" onclick="delAll()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
                    <a href="javascript:;" onclick="_add('添加管理员','/Systems/administrator_add','600','400')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加管理员</a>
                </span>
				<span class="r">共有数据：<strong><?=count($list)?></strong> 条</span>
			</div>
			<table class="table table-border table-bordered table-bg">
				<thead>
					<tr>
						<th scope="col" colspan="9">员工列表</th>
					</tr>
					<tr class="text-c">
                        <th>
                            <input type="checkbox" name="" value="1">
                        </th>
                        <th>
                            ID
                        </th>
                        <th>
                            昵称
                        </th>
                        <th>
                            账号
                        </th>
                        <th>
                            角色
                        </th>
                        <th>
                            加入时间
                        </th>
                        <th>
                            状态
                        </th>
                        <th width="80">
                            操作
                        </th>
					</tr>
				</thead>
				<tbody>
                <? foreach($list as $vo):?>
                <tr class="tr_<?=$vo['id'];?> text-c">
                    <td>
                        <input type="checkbox" value="<?=$vo['id'];?>" name="check">
                    </td>
                    <td>
                        <?=$vo['id'];?>
                    </td>
                    <td>
                        <?=$vo['nickname'];?>
                    </td>
                    <td>
                        <?=$vo['account'];?>
                    </td>
                    <td>
                        <?=$vo['r_name'];?>
                    </td>
                    <td>
                        <?=date('Y-m-d H:i:s',$vo['created_at']);?>
                    </td>
                    <td class="td-status">
                        <? if(1 == $vo['status']):?>
                        <span class="label label-success radius">
                                已启用
                        </span>
                        <? else:?>
                        <span class="label radius">已停用</span>
                        <? endif;?>
                    </td>
                    <td class="td-manage">
                        <? if(1 == $vo['status']):?>
                        <a style="text-decoration:none" onclick="_status_stop(this,'/Systems/administrator_status','<?=$vo['id'];?>')" href="javascript:void(0);" title="停用">
                            <i class="Hui-iconfont">&#xe631;</i>
                        </a>
                        <? else:?>
                        <a style="text-decoration:none" onClick="_status_start(this,'/Systems/administrator_status','<?=$vo['id'];?>')" href="javascript:;" title="启用"><i class="Hui-iconfont">&#xe615;</i></a>
                        <? endif;?>
                        &nbsp;
                        <a title="编辑" href="javascript:;" onclick="_edit('管理员编辑','/Systems/administrator_edit?id=<?=$vo['id'];?>','600','500')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
                        &nbsp;
                        <a title="删除" href="javascript:;" onclick="_del(this,'/System/administrator_del','<?=$vo['id']?>')"   style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>
                    </td>
                </tr>
                <? endforeach;?>
				</tbody>
			</table>
		</article>
	</div>
</section>


<script type="text/javascript" src="/public/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="/public/lib/layer/layer.js"></script>
<script type="text/javascript" src="/public/hui/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/public/hui/static/h-ui.admin/js/H-ui.admin.page.js"></script>
<script type="text/javascript" src="/public/lib/my97/WdatePicker.js"></script>
<script type="text/javascript" src="/public/hui/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/public/hui/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="/public/admin.js"></script>

<script type="text/javascript">
    var menu = "<?=$function;?>";
    if(menu){
        $('.'+menu).addClass('current').parent().addClass('opened').parent().addClass('open').before().addClass('selected');
        setTimeout(function(){
            $('.'+menu).parent().siblings('a').find('.nav_right').html('&#xe61a;');
        },100);
    }


    //批量删除提交
    var arr = [];
    function delAll() {
        layer.confirm('确认要删除吗？', function (index) {
            $('input:checkbox[name=check]:checked').each(function(i){
                arr[i] = $(this).val();
            });

            if(!arr[0]){
                layer.msg('你有病吧!',{icon:2,time:1000});
                return false;
            }
            $.ajax({
                dataType:'json',
                type:'post',
                url:"/Systems/administrator_del",
                data:{id:arr},
                success:function(data){
                    if(1 === data){
                        for(var s in arr){
                            $(".tr_"+arr[s]).remove();
                        }
                        layer.msg('已删除!',{icon:1,time:1000});
                    }
                }
            });
        });
    }
</script>
</body>
</html>